<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.3.6: http://docutils.sourceforge.net/" />
<title>Smart Package Manager</title>
<meta name="author" content="Gustavo Niemeyer" />
<meta name="date" content="2004-12-05 14:29:24 -0200 (Sun, 05 Dec 2004)" />
<link rel="stylesheet" href="default.css" type="text/css" />
</head>
<body>
<h1 class="title">Smart Package Manager</h1>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Gustavo Niemeyer</td></tr>
<tr><th class="docinfo-name">Contact:</th>
<td><a class="first last reference external" href="mailto:niemeyer&#64;conectiva.com">niemeyer&#64;conectiva.com</a></td></tr>
<tr><th class="docinfo-name">Revision:</th>
<td>$Rev$</td></tr>
<tr><th class="docinfo-name">Date:</th>
<td>$Date$</td></tr>
</tbody>
</table>
<div class="document" id="smart-package-manager">
<div class="contents topic" id="contents">
<p class="topic-title first"><a name="contents">Contents</a></p>
<ul class="simple">
<li><a class="reference internal" href="#overview" id="id3" name="id3">Overview</a></li>
<li><a class="reference internal" href="#project-status" id="id4" name="id4">Project Status</a></li>
<li><a class="reference internal" href="#features" id="id5" name="id5">Features</a><ul>
<li><a class="reference internal" href="#modular" id="id6" name="id6">Modular</a></li>
<li><a class="reference internal" href="#smart-transactions" id="id7" name="id7">Smart Transactions</a></li>
<li><a class="reference internal" href="#multiple-interfaces" id="id8" name="id8">Multiple Interfaces</a></li>
<li><a class="reference internal" href="#channels" id="id9" name="id9">Channels</a></li>
<li><a class="reference internal" href="#priority-handling" id="id10" name="id10">Priority Handling</a></li>
<li><a class="reference internal" href="#autobalancing-mirror-system" id="id11" name="id11">Autobalancing Mirror System</a></li>
<li><a class="reference internal" href="#downloading-mechanism" id="id12" name="id12">Downloading Mechanism</a></li>
<li><a class="reference internal" href="#removable-media-support" id="id13" name="id13">Removable Media Support</a></li>
</ul>
</li>
<li><a class="reference internal" href="#running-smart" id="id14" name="id14">Running Smart</a></li>
<li><a class="reference internal" href="#building-smart" id="id15" name="id15">Building Smart</a><ul>
<li><a class="reference internal" href="#dependencies" id="id16" name="id16">Dependencies</a></li>
</ul>
</li>
<li><a class="reference" href="#case-studies" id="id17" name="id17">Case Studies</a><ul>
<li><a class="reference" href="#case-1-apt" id="id18" name="id18">Case 1 - APT</a></li>
<li><a class="reference" href="#case-2-apt-yum" id="id19" name="id19">Case 2 - APT &amp; YUM</a></li>
<li><a class="reference" href="#case-3-apt-yum" id="id20" name="id20">Case 3 - APT &amp; YUM</a></li>
<li><a class="reference" href="#case-4-apt" id="id21" name="id21">Case 4 - APT</a></li>
</ul>
</li>
<li><a class="reference" href="#credits" id="id22" name="id22">Credits</a></li>
</ul>
</div>
<div class="section" id="overview">
<h1><a class="toc-backref" href="#id3" name="overview">Overview</a></h1>
<p>The <strong>Smart Package Manager</strong> project has the ambitious objective of
creating smart and portable algorithms for solving adequately the
problem of managing software upgrading and installation. This tool
works in all major distributions, and will bring notable advantages
over native tools currently in use (APT, APT-RPM, YUM, URPMI, etc).</p>
<p>From <cite>The Free On-line Dictionary of Computing</cite>:</p>
<pre class="literal-block">
smart

    1. &lt;programming&gt; Said of a program that does the {Right Thing}
    in a wide variety of complicated circumstances. (...)
</pre>
</div>
<div class="section" id="project-status">
<h1><a class="toc-backref" href="#id4" name="project-status">Project Status</a></h1>
<p>The development of Smart Package Manager started on May 4th, 2004, and
version 1.0 was released on Aug 14th, 2008, after extended beta testing.</p>
</div>
<div class="section" id="features">
<h1><a class="toc-backref" href="#id5" name="features">Features</a></h1>
<div class="section" id="modular">
<h2><a class="toc-backref" href="#id6" name="modular">Modular</a></h2>
<p>Smart has been developed with modularity and flexibility in mind. It's
completely backend-based, and package-manager-agnostic. Support is
currently implemented for <strong>RPM</strong>, <strong>DPKG</strong>, and <strong>Slackware</strong>
package management systems, and porting it to new systems should be
very easy.</p>
</div>
<div class="section" id="smart-transactions">
<h2><a class="toc-backref" href="#id7" name="smart-transactions">Smart Transactions</a></h2>
<p>That's one of the most interesting aspects of Smart Package Manager,
and the one who has motivated calling it <cite>smart</cite>. Computing
transactions respecting the relations involved in the package
management world may become an unpleasant task when thousands of
packages and relations are being considered, or even when just
a few complex relations turn the most obvious choice into the
unwanted one.</p>
<p>While other applications try to find a possible solution to satisfy
the relations involved in some user-requested operation, and
sometimes even fail to do so <a class="footnote-reference" href="#id2" id="id1" name="id1">[1]</a>, Smart goes beyond it. In the
kernel of Smart Package Manager lives an algorithm that will
not only find a solution, if one is available, but will find
the best solution. This is done by quickly weighting every
possible solution with a pluggable policy, which redefines
the term &quot;best&quot; depending on the operation goal (install,
remove, upgrade, etc).</p>
<p>This behavior has many interesting consequences. In upgrades,
for instance, while precedence is given to newer versions,
intermediate versions may get selected if they bring a
better global result for the system. Packages may even be
reinstalled, if different packages with the same name-version
pair have different relations, and the one not installed
is considered a better option.</p>
<p>Another important goal achieved with the transaction algorithm
is that, even though it is able to check and fix relations in
the whole system, it will work even when there are broken
relations in installed packages. Only relations related to
the operation being made are checked for correctness.</p>
<table class="docutils footnote" frame="void" id="id2" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id1" name="id2">[1]</a></td><td>Check <a class="reference internal" href="#case-studies">Case Studies</a> for real cases where the algorithm
works better than what is implemented in other applications.</td></tr>
</tbody>
</table>
</div>
<div class="section" id="multiple-interfaces">
<h2><a class="toc-backref" href="#id8" name="multiple-interfaces">Multiple Interfaces</a></h2>
<p>Smart has multiple native and completely integrated interfaces:</p>
<ul class="simple">
<li>Command line interface, with several useful subcommands: update,
install, reinstall, upgrade, remove, check, fix, download, search,
and more.</li>
<li>Shell interface, with command and argument completion, making it
easy to perform multiple operations quickly using a local or
remote terminal.</li>
<li>Graphic interface, offering the friendliness of visual
user interaction.</li>
<li>Command line interface with graphic feedback, allowing one to
integrate the power of command line with graphic environments.</li>
</ul>
<p>Besides these interfaces, ksmarttray is also included in the Smart
package. It notifies users about available updates using a KDE
tray icon.</p>
</div>
<div class="section" id="channels">
<h2><a class="toc-backref" href="#id9" name="channels">Channels</a></h2>
<p>Channels are the way Smart becomes aware about external repositories
of information. Many different channel types are supported, depending
on the backend and kind of information desired:</p>
<ul class="simple">
<li>APT-DEB Repository</li>
<li>APT-RPM Repository</li>
<li>DPKG Installed Packages</li>
<li>Mirror Information</li>
<li>Red Carpet Channel</li>
<li>RPM Directory</li>
<li>RPM Header List</li>
<li>RPM MetaData (YUM)</li>
<li>RPM Installed Packages</li>
<li>Slackware Repository</li>
<li>Slackware Installed Packages</li>
<li>URPMI Repository</li>
</ul>
</div>
<div class="section" id="priority-handling">
<h2><a class="toc-backref" href="#id10" name="priority-handling">Priority Handling</a></h2>
<p>Priorities are a powerful way to easily handle integration
of multiple channels and explicit user setups regarding
preferred package versions.</p>
<p>Basically, packages with higher priorities are considered a
better option to be installed in the system, even when package
versions state otherwise. Priorities may be individually
assigned to all packages in given channels, to all packages
with given names, and to packages with given names inside
given channels.</p>
<p>With custom priority setups, it becomes possible to avoid
unwanted upgrades, force downgrades, select packages in given
channels as preferential, and other kinds of interesting setups.</p>
</div>
<div class="section" id="autobalancing-mirror-system">
<h2><a class="toc-backref" href="#id11" name="autobalancing-mirror-system">Autobalancing Mirror System</a></h2>
<p>Smart offers a very flexible mirror support. Mirrors are URLs
that supposedly provide the same contents as are available in
other URLs, named origins. There is no internal restriction on
the kind of information which is mirrored. Once an origin URL
is provided, and one or more mirror URLs are provided, these
mirrors will be considered for any file which is going to be
fetched from an URL starting with the origin URL.</p>
<p>Mirror precedence is dynamically computed based on the history
of downloads of all mirrors available for a given origin URL
(including the origin site itself). The fastest mirrors and
with less errors are chosen. When errors occur, the next
mirror in the queue is tried.</p>
<p>For instance, if a mirror <cite>http://mirror.url/path/</cite> is provided
for the origin <cite>ftp://origin.url/other/path/</cite>, and a file in
<cite>ftp://origin.url/other/path/subpath/somefile</cite> is going to be
fetched, the mirror will be considered for being used, and the
URL <cite>http://mirror.url/path/subpath/somefile</cite> will be used if
the mirror is chosen. Notice that strings are compared and
replaced without any pre-processing, so that it's possible to
use different schemes (ftp, http, etc) in mirror entries, and
even URLs ending in prefixes of directory entries.</p>
</div>
<div class="section" id="downloading-mechanism">
<h2><a class="toc-backref" href="#id12" name="downloading-mechanism">Downloading Mechanism</a></h2>
<p>Smart has a fast parallel downloading mechanism, allowing multiple
connections to be used for one or more sites. The mechanism
supports:</p>
<ul class="simple">
<li>Resuming</li>
<li>Timestamp checking</li>
<li>Parallel uncompression</li>
<li>Autodetection of FTP user limit</li>
<li>Cached file validation</li>
</ul>
<p>and more.</p>
<p>At the moment, the following schemes are nativelly supported:</p>
<ul class="simple">
<li>file</li>
<li>ftp</li>
<li>http</li>
<li>https</li>
<li>scp</li>
</ul>
<p>Additionally, the following schemes are supported when pycurl is
available:</p>
<ul class="simple">
<li>ftps</li>
<li>telnet</li>
<li>dict</li>
<li>ldap</li>
</ul>
</div>
<div class="section" id="removable-media-support">
<h2><a class="toc-backref" href="#id13" name="removable-media-support">Removable Media Support</a></h2>
<p>Smart Package Manager implements builtin support for removable media
(CDROMs, DVDs, etc) in most of the supported channel types. The
following features are currently implemented:</p>
<ul class="simple">
<li>Mountpoint autodetection</li>
<li>Support for multiple simultaneous media drives</li>
<li>Medias may be inserted in any order</li>
<li>Installed system is guaranteed to maintain correct relations
between media changes</li>
<li>Remote removable media support using any of the supported schemes
(ftp, http, scp, etc)</li>
</ul>
</div>
</div>
<div class="section" id="running-smart">
<h1><a class="toc-backref" href="#id14" name="running-smart">Running Smart</a></h1>
<p>Smart Package Manager may be run in many different ways, depending
on the interface in use and on the intended goal.</p>
<p>The following command would install the <cite>foobar</cite> package, for instance:</p>
<pre class="literal-block">
smart install foobar
</pre>
<p>While the following command would install the <cite>foobar</cite> package, but with
graphic output:</p>
<pre class="literal-block">
smart --gui install foobar
</pre>
<p>To open the graphic interface in interactive mode, one may simply run:</p>
<pre class="literal-block">
smart --gui
</pre>
<p>Similarly, the following command would open the shell interface:</p>
<pre class="literal-block">
smart --shell
</pre>
<p>Extensive help is available for all commands, by using the <cite>--help</cite>
switch:</p>
<pre class="literal-block">
smart --help
smart install --help
smart channel --help
...
</pre>
</div>
<div class="section" id="building-smart">
<h1><a class="toc-backref" href="#id15" name="building-smart">Building Smart</a></h1>
<div class="section" id="dependencies">
<h2><a class="toc-backref" href="#id16" name="dependencies">Dependencies</a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Core:</th><td class="field-body"><p class="first">Smart is written in Python, with some core modules rewritten as
C extensions for memory savings and performance gains. With that
in mind, the core system of Smart depends on Python 2.3 or
higher, and a C compiler to build the extensions.</p>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Graphic Interface:</th></tr>
<tr><td>&nbsp;</td><td class="field-body"><p class="first">The &quot;gtk&quot; graphic interface depends on <cite>pygtk</cite> 2.4 or higher.
The &quot;qt&quot; graphic interface depends on <cite>pyqt</cite> 3.3 (not 4.x).</p>
</td>
</tr>
<tr class="field"><th class="field-name">RPM backend:</th><td class="field-body"><p class="first">The RPM backend depends on the Python <cite>rpm</cite> module of RPM 4.4 or
higher, due to a limitation which was present in previous versions
of the <cite>ts.dbMatch()</cite> method, and the availability of the
<cite>readHeaderFromFD()</cite> function.</p>
<p>In the <cite>contrib/patches/</cite> subdirectory there are patches for
previous RPM versions including the missing functionality. There
are also pre-packaged binary versions which include the patched
module without requiring changes in other tools.</p>
</td>
</tr>
<tr class="field"><th class="field-name">DPKG backend:</th><td class="field-body"><p class="first">There are no extra dependencies besides DPKG itself.</p>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Slackware backend:</th></tr>
<tr><td>&nbsp;</td><td class="field-body"><p class="first last">There are no extra dependencies besides the packaging scripts
<cite>installpkg</cite>, <cite>upgradepkg</cite> and <cite>removepkg</cite>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="case-studies">
<h1><a class="toc-backref" href="#id17" name="case-studies">Case Studies</a></h1>
<p>In this section will be described real cases showing <cite>Smart</cite> behavior
in comparison with other tools, or handling unusual situations.</p>
<p>Notice that Smart was not tuned to work in any of these cases, and
the reason it works is because handling unusual situations was the
initial project goal.</p>
<div class="section" id="case-1-apt">
<h2><a class="toc-backref" href="#id18" name="case-1-apt">Case 1 - APT</a></h2>
<p>This case happened in a real world environment where a weakness in
the algorithm used by <cite>APT</cite> (which is the same used in <cite>APT-RPM</cite>)
turned a simple operation into a problem of obscure results.
Smart Package Manager was used in the same environment to show
its results.</p>
<p>The problem starts when an installation of <cite>xscreensaver</cite> is tried:</p>
<pre class="literal-block">
[root&#64;damien:/root] apt-get install xscreensaver
Reading Package Lists... Done
Building Dependency Tree... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  xscreensaver: Depends: libglade-2.0.so.0
                Depends: libxml2.so.2
E: Broken packages
</pre>
<p>The error shown makes the user believe that <cite>libglade-2.0.so.0</cite> and
<cite>libxml2.so.2</cite> are not available. That's not the case:</p>
<pre class="literal-block">
[root&#64;damien:/root] apt-get install libxml2
Reading Package Lists... Done
Building Dependency Tree... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  libxml2: Depends: glibc-iconv but it is not going to be installed
E: Broken packages
</pre>
<p>Another misguiding error message. Let's go further:</p>
<pre class="literal-block">
[root&#64;damien:/root] apt-get install glibc-iconv
Reading Package Lists... Done
Building Dependency Tree... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  glibc-iconv: Depends: glibc-gconvdata (= 2.3.3) but 1:2.3.2-586_1cl is to be installed
E: Broken packages
</pre>
<p>Version <cite>2.3.3</cite> is needed, but <cite>1:2.3.2-586_1cl</cite> is to be installed. This
message is mostly correct. The only problem is, &quot;1:2.3.2-586_1cl&quot; is
already installed:</p>
<pre class="literal-block">
[root&#64;damien:/root] apt-cache policy glibc-gconvdata
glibc-gconvdata:
  Installed: 1:2.3.2-586_1cl
  Candidate: 1:2.3.2-586_1cl
  Version Table:
 *** 1:2.3.2-586_1cl 0
        100 RPM Database
     0:2.3.3-69473cl 0
        500 file: conectiva/all pkglist
</pre>
<p>The problem was found. A package from another repository (586_1cl shows
it's not native, in that specific case) has a higher epoch than the one
available in the usual repository. This clearly shows that the APT
algorithm marks a single version as candidate, and when this is not the
wanted version for some operation, the whole operation is compromised.</p>
<p>When testing <cite>Smart Package Manager</cite> in the same environment, the
expected result is obtained:</p>
<pre class="literal-block">
[root&#64;damien:/root] smart install xscreensaver
Updating cache...              ######################################## [100%]

Computing transaction...

Downgrading packages (1):
  glibc-gconvdata-0:2.3.3-69473cl.i386

Installing packages (4):
  glibc-iconv-0:2.3.3-69473cl.i386
  libglade2-2.4.0-68154cl.i386
  libxml2-2:2.6.13-67598cl.i386
  xscreensaver-4.15-69825cl.i386

Confirm changes (Y/n)?
</pre>
<p>Smart correctly selected <cite>glibc-gconvdata</cite> for downgrading as the only
possibility of performing the user requested operation.</p>
</div>
<div class="section" id="case-2-apt-yum">
<h2><a class="toc-backref" href="#id19" name="case-2-apt-yum">Case 2 - APT &amp; YUM</a></h2>
<p>This is another real case, and is being reproduced in a controlled
environment for tests with YUM, APT-RPM, and Smart.</p>
<p>The issue is, a package named <cite>A</cite> requires package <cite>BCD</cite> explicitly, and
RPM detects implicit dependencies between <cite>A</cite> and <cite>libB</cite>, <cite>libC</cite>, and <cite>libD</cite>.
Package <cite>BCD</cite> provides <cite>libB</cite>, <cite>libC</cite>, and <cite>libD</cite>, but additionally there
is a package <cite>B</cite> providing <cite>libB</cite>, a package <cite>C</cite> providing <cite>libC</cite>, and
a package <cite>D</cite> providing <cite>libD</cite>.</p>
<p>In other words, there's a package <cite>A</cite> which requires four different symbols,
and one of these symbols is provided by a single package <cite>BCD</cite>, which happens
to provide all symbols needed by <cite>A</cite>. There are also packages <cite>B</cite>, <cite>C</cite>, and <cite>D</cite>,
that provide some of the symbols required by <cite>A</cite>, but can't satisfy all
dependencies without <cite>BCD</cite>.</p>
<p>The expected behavior for an operation asking to install <cite>A</cite> is obviously
selecting <cite>BCD</cite> to satisfy <cite>A</cite>'s dependencies, on the other hand, <cite>YUM</cite> and
APT fail to deliver that as a guaranteed operation, as is shown
below.</p>
<p>First, let's see how YUM deals with the problem:</p>
<pre class="literal-block">
[root&#64;burma ~]% yum install A
Setting up Install Process
Setting up Repo:  localpub
repomd.xml                100% |=========================|  951 B    00:00
Reading repository metadata in from local files
localpub  : ################################################## 5/5
Resolving Dependencies
--&gt; Populating transaction set with selected packages. Please wait.
---&gt; Downloading header for A to pack into transaction set.
A-1.0-1cl.i386.rpm        100% |=========================| 1.0 kB    00:00
---&gt; Package A.i386 0:1.0-1cl set to be installed
--&gt; Running transaction check
--&gt; Processing Dependency: libD for package: A
--&gt; Processing Dependency: libC for package: A
--&gt; Processing Dependency: libB for package: A
--&gt; Processing Dependency: BCD for package: A
--&gt; Restarting Dependency Resolution with new changes.
--&gt; Populating transaction set with selected packages. Please wait.
---&gt; Downloading header for D to pack into transaction set.
D-1.0-1cl.i386.rpm        100% |=========================| 1.0 kB    00:00
---&gt; Package D.i386 0:1.0-1cl set to be installed
---&gt; Downloading header for C to pack into transaction set.
C-1.0-1cl.i386.rpm        100% |=========================| 1.0 kB    00:00
---&gt; Package C.i386 0:1.0-1cl set to be installed
---&gt; Downloading header for B to pack into transaction set.
B-1.0-1cl.i386.rpm        100% |=========================| 1.0 kB    00:00
---&gt; Package B.i386 0:1.0-1cl set to be installed
---&gt; Downloading header for BCD to pack into transaction set.
BCD-1.0-1cl.i386.rpm      100% |=========================| 1.0 kB    00:00
---&gt; Package BCD.i386 0:1.0-1cl set to be installed
--&gt; Running transaction check

Dependencies Resolved
Transaction Listing:
  Install: A.i386 0:1.0-1cl

Performing the following to resolve dependencies:
  Install: B.i386 0:1.0-1cl
  Install: BCD.i386 0:1.0-1cl
  Install: C.i386 0:1.0-1cl
  Install: D.i386 0:1.0-1cl
Is this ok [y/N]:
</pre>
<p>YUM selected <strong>all</strong> packages for installation, even though <cite>BCD</cite>
alone would satisfy <cite>A</cite>'s dependencies.</p>
<p>Let's see how APT deals with that:</p>
<pre class="literal-block">
[root&#64;burma ~]% apt-get install A
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
  B BCD
The following NEW packages will be installed:
  A B BCD
0 upgraded, 3 newly installed, 0 removed and 0 not upgraded.
Need to get 0B/4055B of archives.
After unpacking 0B of additional disk space will be used.
Do you want to continue? [Y/n] n
</pre>
<p>As a coincidence, APT did a better job, and selected only <cite>B</cite> and
<cite>BCD</cite> to satisfy <cite>A</cite>'s dependency, which is still not right.</p>
<p>Now, let's see how Smart would solve the problem:</p>
<pre class="literal-block">
[root&#64;burma ~]% smart install A
Updating cache...               ######################################## [100%]

Computing transaction...

Installing packages (2):
  A-1.0-1cl&#64;i386     BCD-1.0-1cl&#64;i386

2.7kb of package files are needed.

Confirm changes (Y/n)?
</pre>
<p>Smart correctly selected only <cite>BCD</cite>, since it's necessary anyway, and
solves all dependencies.</p>
</div>
<div class="section" id="case-3-apt-yum">
<h2><a class="toc-backref" href="#id20" name="case-3-apt-yum">Case 3 - APT &amp; YUM</a></h2>
<p>That's another interesting case which was tested with APT-RPM and YUM.</p>
<p>In this case, there's a package <cite>A</cite> version 1.0 installed in the
system, and there are two versions available for upgrading: 1.5 and 2.0.
Version 1.5 may be installed without problems, but version 2.0 has a
dependency on <cite>B</cite>, which is not available anywhere.</p>
<p>In this case, the best possibility is upgrading to 1.5, since upgrading
to 2.0 is not an option.</p>
<p>Let's see how APT reacts to this situation:</p>
<pre class="literal-block">
[root&#64;burma ~]% apt-get upgrade A
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages have been kept back
  A
0 upgraded, 0 newly installed, 0 removed and 1 not upgraded.
</pre>
<p>APT seems to refuse to upgrade <cite>A</cite>, even though version 1.5 might be
installed without problems.</p>
<p>What happens when forcing APT to install <cite>A</cite>:</p>
<pre class="literal-block">
[root&#64;burma ~]% apt-get install A
Reading Package Lists... Done
Building Dependency Tree... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  A: Depends: B but it is not installable
E: Broken packages
</pre>
<p>It really refuses to install the newest version, and doesn't consider
the possibility of using version 1.5.</p>
<p>Now, let's see how YUM would handle it.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Update:</th><td class="field-body">This test case was showing the wrong results for YUM, since it
was using a cached version of the package header that didn't
present the missing dependency. I apologise for showing invalid
results.</td>
</tr>
</tbody>
</table>
<pre class="literal-block">
[root&#64;burma ~]% yum update
Setting up Update Process
Setting up Repo:  localpub
repomd.xml                100% |=========================|  951 B    00:00
Reading repository metadata in from local files
primary.xml.gz            100% |=========================|  809 B    00:00
MD Read   : ################################################## 3/3
localpub  : ################################################## 3/3
Resolving Dependencies
--&gt; Populating transaction set with selected packages. Please wait.
---&gt; Downloading header for A to pack into transaction set.
A-2.0-1cl.i386.rpm        100% |=========================| 1.3 kB    00:00
---&gt; Package A.i386 0:2.0-1cl set to be updated
--&gt; Running transaction check
--&gt; Processing Dependency: B for package: A
--&gt; Finished Dependency Resolution
Error: missing dep: B for pkg A
</pre>
<p>Just like APT, YUM selected version 2.0 and didn't consider the
availability of an intermediate version.</p>
<p>Now, let's see how Smart would behave in the same situation:</p>
<pre class="literal-block">
[root&#64;burma ~]% smart upgrade
Loading cache...
Updating cache...               ######################################## [100%]

Computing transaction...

Upgrading packages (1):
  A-1.5-1cl&#64;i386

1.3kb of package files are needed.

Confirm changes (Y/n)?
</pre>
<p>Smart correctly selects the intermediate version 1.5, which is the
only viable possibility given the current options.</p>
</div>
<div class="section" id="case-4-apt">
<h2><a class="toc-backref" href="#id21" name="case-4-apt">Case 4 - APT</a></h2>
<p>This case presents the following situation: there's a package <cite>A</cite>,
installed in the system, which depends on <cite>libfoo</cite>, currently
being provided by <cite>B</cite> 1.0. What happens if <cite>B</cite> is upgraded to
version 2.0, but <cite>libfoo</cite> is moved to be provided by package <cite>C</cite>?</p>
<p>The expected behavior would be to upgrade <cite>B</cite> to version 2.0,
and install <cite>C</cite> to satisfy <cite>A</cite>'s dependency.</p>
<p>That's not what happens with APT:</p>
<pre class="literal-block">
[root&#64;burma ~]% apt-get dist-upgrade
Reading Package Lists... Done
Building Dependency Tree... Done
Calculating Upgrade... Done
The following packages will be upgraded
  B
The following packages will be REMOVED:
  A
1 upgraded, 0 newly installed, 1 removed and 0 not upgraded.
Need to get 0B/1321B of archives.
After unpacking 0B of additional disk space will be used.
Do you want to continue? [Y/n]
</pre>
<p>Let's see Smart in the same situation:</p>
<pre class="literal-block">
[root&#64;burma ~]% smart upgrade
Loading cache...
Updating cache...               ######################################## [100%]

Computing transaction...

Upgrading packages (1):
  B-2.0-1cl&#64;i386

Installing packages (1):
  C-2.0-1cl&#64;i386

2.6kB of package files are needed.

Confirm changes (Y/n)?
</pre>
<p>Smart correctly selected package <cite>C</cite> for installation as a viable
possibility of leaving <cite>A</cite> installed in the system while upgrading
<cite>B</cite>.</p>
</div>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id22" name="credits">Credits</a></h1>
<p>This is the credit section, where people and institutions that
have somehow contributed to the project are mentioned.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">Conectiva, Inc.:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">Funded the creation of Smart, and its development up to
August of 2005.</td>
</tr>
<tr class="field"><th class="field-name">Canonical Ltd:</th><td class="field-body">Is funding Smart development since September of 2005.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Wanderlei Cavassin:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">Conectiva's research &amp; development coordinator, who believed
the project was viable and encouraged the author to work on it.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Ednilson Miura &amp; Herton Ronaldo Krzesinski:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">Conectiva employees, helped setting up many distributions
for tests whenever necessary.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Andreas Hasenack:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">Conectiva employee, helped as being the first brave pre-alpha
tester, and contributed with many ideas, discussions, etc.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Arnaldo Carvalho de Melo:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">Conectiva board member, helped with the &quot;channel of mirrors&quot; idea
and by encouraging the author to build a generic channel
information method.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Others &#64; Conectiva:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">Many other people in Conectiva helped with ideas and
alpha-testing in general during the pre-release period of
Smart development.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Guilerme Manika &amp; Ruda Moura:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">Ancient Conectiva employees, now board members of the Haxent company,
helped by testing Smart extensively in Fedora, reporting many
bugs and suggesting changes. They have also created the Smart
<a class="reference external" href="http://zorked.net/smart/FAQ.html">FAQ</a>.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">APT-RPM &amp; Debian:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">Experience on packaging and ideas for a better framework were
developed while the author of Smart worked as the <cite>APT-RPM</cite>
maintainer.</td>
</tr>
<tr class="field"><th class="field-name">Jeff Johnson:</th><td class="field-body">Contributed as being the RPM maintainer itself, and in
many discussions regarding packaging theory in general.</td>
</tr>
<tr class="field"><th class="field-name">Seth Vidal:</th><td class="field-body">YUM author, and member of the Duke University, contributed
to Smart with the development of the XML <cite>MetaData</cite> repository
format and discussions about it.</td>
</tr>
<tr class="field"><th class="field-name">Michael Vogt:</th><td class="field-body">Currently the maintainer of the Synaptic, used to co-maintain it
with the author of Smart. Many of his ideas ended up being adopted
in Smart as a consequence.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Sebastian Heinlein:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">Author of the package icons for Synaptic, that were mercilessly
stolen to be used in Smart's graphic interface.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">TaQ/PiterPunk at #slackware-br:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">These guys helped Smart development by explaining details of
Slackware practices regarding packaging.</td>
</tr>
<tr class="field"><th class="field-name">Matt Zimmerman:</th><td class="field-body">Debian/Ubuntu developer and co-maintainer of the APT software,
helped by shining some light regarding details of the <cite>DPKG</cite>
pre-depends ordering expectations.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Mauricio Teixeira:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">FAQ maintenance, YaST2 channel maintainer, &quot;tracker cleaner&quot;,
general suggestions and code contributions.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">Jonathan Rocker:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">Documentation help.</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>
